import { getTemplates } from "@/service";
import { FC, useEffect } from "react";
import List from "./_list";
import { useSetState } from "ahooks";
interface IndexProps {}

const Index: FC<IndexProps> = () => {
  const [state, setState] = useSetState({
    list: [],
  });
  useEffect(() => {
    getTemplates().then((res) => {
      if (res.code === 200) {
        setState({
          list: res.data || [],
        });
      }
    });
  }, []);

  return <List list={state.list} />;
};

export default Index;
